// 账号判定
var loginByPsd_name = document.querySelector('#loginName');
var loginByPsd_acc = document.querySelector('#lg_account');
function getAccount() {
    if (loginByPsd_name.value == "" || loginByPsd_name.value == null) {
        loginByPsd_acc.firstElementChild.nextElementSibling.style.display = "inline-block";
        return false;
    } else if (!/^[1][3,4,5,7,8][0-9]{9}$/.test(loginByPsd_name.value)) {
        loginByPsd_acc.firstElementChild.nextElementSibling.innerText = "账号格式错误";
        loginByPsd_acc.firstElementChild.nextElementSibling.style.display = "inline-block";
        return false;
    } else {
        loginByPsd_acc.firstElementChild.nextElementSibling.style.display = "none";
        return true;
    }
}
// 密码判定
var loginByPsd_pas = document.querySelector('#lg_pass');
var loginByPsd_password = document.querySelector('#loginPsd');
function getPassword() {
    if (loginByPsd_password.value == "" || loginByPsd_password.value == null) {
        loginByPsd_pas.firstElementChild.nextElementSibling.style.display = "inline-block";
        return false;
    } else if (!/^[0-9A-Za-z]{6,12}$/.test(loginByPsd_password.value)) {
        loginByPsd_pas.firstElementChild.nextElementSibling.innerText = "密码错误";
        loginByPsd_pas.firstElementChild.nextElementSibling.style.display = "inline-block";
        return false;
    } else {
        loginByPsd_pas.firstElementChild.nextElementSibling.style.display = "none";
        return true;
    }
}

document.querySelector("#login-btn").onclick = function () {
    localStorage.setItem("user", "123");
    window.location.href = "../index/zhaopin_index.html";
};